#pragma once

#include "ConnectSocket.h"
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment (lib, "Ws2_32.lib")
class CListenSocket
{
	SOCKET listenSocket;
public:
	bool Create(const char *szPort);
	bool Listen(int nConnectionBacklog = 5);
	bool Accept(CConnectSocket &connectSocket, sockaddr *addr = NULL, int *addrLen = NULL);
	void Close();
	CListenSocket(void);
	~CListenSocket(void);
	SOCKET& GetSocket();
	bool isInvalidSocket();
};
